<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use backend\components\Option;
use backend\models\Permission;
/* @var $this yii\web\View */
/* @var $model app\models\Permission */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="permission-form">

    <?php 
        $form = ActiveForm::begin([
            'options'=>['class' => 'form-horizontal', 'enctype'=>'multipart/form-data'],
            'fieldConfig' => [
                'template' => "{label}\n<div class=\"col-lg-4\">{input}</div>\n<div class=\"col-lg-4\">{error}</div>",
                'labelOptions' => ['class' => 'col-lg-2 control-label'],
            ],
        ]); 
    ?>

    

    <?= $form->field($model, 'name')->textInput(['maxlength' => 255]) ?>

    <?= $form->field($model, 'code')->textInput(['maxlength' => 200]) ?>

   
    <?= $form->field($model, 'parent_id')->dropDownList(Permission::getArrayParent()) ?>

    <?= $form->field($model, 'number')->textInput() ?>
    
   <?= $form->field($model, 'status')->dropDownList(Option::getArrayStatus()) ?>
    

     <div class="form-group">
        <label class="col-lg-2 control-label" for="">&nbsp;</label>
        <?= Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
    </div>

    <?php ActiveForm::end(); ?>

</div>
